package com.tulingxueyuan.mall.modules.fms.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tulingxueyuan.mall.common.api.CommonPage;
import com.tulingxueyuan.mall.common.api.CommonResult;
import com.tulingxueyuan.mall.modules.fms.model.dto.FactoryConditionDTO;
import com.tulingxueyuan.mall.modules.fms.service.FmsFactoryService;
import com.tulingxueyuan.mall.modules.pms.model.dto.ProductFarmerConditionDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Bin
 * @since 2022-09-07
 */
@RestController
@RequestMapping("/factory")
public class FmsFactoryController {

    @Autowired
    FmsFactoryService factoryService;

    /**
     * 工厂列表-数据列表接口
     * url:'/factory/list',
     * method:'get',
     * params:params
     *
     * 参数较多，声明为 DTO对象
     */
    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public CommonResult getList(FactoryConditionDTO condition){
        Page page = factoryService.list(condition);
        return CommonResult.success(CommonPage.restPage(page));
    }

}

